require("../../$res/plugin/bootstrap-select");
module.exports = {
    template: require("./tpl/filter.htm"),
    props: {
        type: String,
        tips: String,
        width: Number,
        search: Boolean,
        selected: String
    },
    data: function () {
        return {
            res: new Date().getTime()
        }
    },
    mounted: function () {
        var $this = this;
        var ele = '#' + $this.type + $this.res;
        $(ele).selectpicker()
            .on('hidden.bs.select', function (e) {
                $this.$emit("input", $(this).val());
                $this.$nextTick(function () {
                    $(ele).selectpicker('refresh');
                })
            });
    }
};
